package com.guangyunl.h_param;
// 引用数据类型做方法参数传递时，传递的是地址值
public class Demo02Param {
    public static void main(String[] args) {
        int[] arr = {10, 20};
        method(arr);
        System.out.println("==============");
        System.out.println("arr[0] = " + arr[0]); // 20
        System.out.println("arr[1] = " + arr[1]); // 40
    }

    public static void method(int[] arr){
        arr[0] += 10;
        arr[1] += 20;
        System.out.println("arr[0] = " + arr[0]); // 20
        System.out.println("arr[1] = " + arr[1]); // 40
    }
}
/*
arr[0] = 20
arr[1] = 40
==============
arr[0] = 20
arr[1] = 40
 */